import { Ref } from 'vue'

export function findMenus(menus: any[], ref: Ref, route: string) {
  for (const key of menus) {
    if (key.url === route) {
      ref.value = String(key.id)
      return false
    }
    if (key.children) {
      findMenus(key.children, ref, route)
    }
  }
}
